<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>纳税金额</title>
		<script type="text/javascript">
			function sum(){
				var salary=prompt("输入工资金额：（元）");//工资
				if(salary<=3500){
					var money=0;
					//纳税金额
				}else if(salary<=8000){
					money=(salary-3500)*0.02
				}else if(salary<=20000){
					money=(8000-3500)*0.02+(salary-8000)*0.05;
				}else{
					money=(8000-3500)*0.02+(20000-8000)*0.05+(salary-20000)*0.1;
				}
				alert(money);
			}
			
				
		</script>
	</head>
	<body>
		<input type="button"  value="纳税金额是:" onclick="sum()" />
	</body>
</html>